<!DOCTYPE html>
<html>
  <head>
    <title>个人信息</title>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <!-- form 样式 -->
    <link href="__STATIC__/form/style.css" rel='stylesheet' type='text/css' />
    <link href="__STATIC__/form/font-awesome.css" rel="stylesheet">

    <link href="__STATIC__/form/animate.css" rel="stylesheet" type="text/css" media="all">
    <link href="__STATIC__/form/add.css" rel="stylesheet" type="text/css" media="all">

    <link rel="stylesheet" href="__STATIC__/mobile/css/weui.min.css">
	<link rel="stylesheet" href="__STATIC__/mobile/css/jquery-weui.css">
    <!-- <link rel="stylesheet" href="css/style.min.css"> -->
    <link rel="stylesheet" href="__STATIC__/mobile/css/demos.css">
    <link rel="stylesheet" href="__STATIC__/mobile/css/main.css">
    <link rel="stylesheet" href="__STATIC__/mobile/css/iconfont.css">
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=DA6Bw0637vf4t96C4GRhyPBMyplqG6zA"></script>
    <script src="__STATIC__/mobile/js/jquery-2.1.4.js"></script>
    <style>
    	.navbar {
		    height: 50px;
		    color: #000;
		    background: #ffd966;
		    position: fixed;
		    top: 0;
		    left: 0;
		    right: 0;
		    z-index: 99;
		    display: -webkit-box;
		    display: -ms-flexbox;
		    overflow: hidden;
		}
		.navbar .nav-wrap-left {
		    height: 100%;
		    width: 25%;
		    line-height: 50px;
		}
		.navbar .nav-wrap-left .nav-btn {
		    padding-right: 0;
		}
		.navbar .nav-btn {
		    padding: 0 0 0 10%;
		   	width: 90%;
		   	height: 100%;
		    display: block;
		    color: #000;
		    font-size: 14px;
		}
		/*a:active, a:focus, a:hover, a:visited {
		    color: #bbb;
		}*/
		a, a:hover, del, ins, s, u {
		    text-decoration: none;
		}
		.barbtn, a, button, em, input, textarea {
		    -webkit-tap-highlight-color: rgba(255,0,0,0);
		}
		a {
		    color: #222;
		    text-decoration: none;
		    outline: 0;
		}
		.navbar .nav-title {
			width: 50%;
		    height: 100%;
		    overflow: hidden;
		    line-height: 50px;
		    text-align: center;
		    -webkit-box-flex: 1;
		    -ms-flex: 1;
		}
		.navbar .nav-wrap-right {
		    height: 100%;
		    width: 25%;
		    line-height: 50px;
		    text-align: right;
		}
		.filterbar .dropdown-toggle.active {
		    color: #179b16;
		}
		.icon-xuanzechengshi {
			font-size: 8px!important;
		}
		#joblist .list-item .salary span, #loadMore .list-item .salary span, #recommend-job .list-item .salary span {
		    color: #179b16;
		    font-size: .42rem;
		}
		.pic {
			width: 55px!important;
		}
		.pic img{
			width: 55px!important;
			height: 55px;
		}
		.filterbar .dropdown-wrapper {
		    position: absolute;
		    width: 100%;
		    z-index: inherit;
		}
		.filterbar .nav {
		    position: relative;
    		z-index: inherit;
		}
		.block {
			display: block;
		}
		.none {
			display: none;
		}
		.filterbar .nav {
		    display: -webkit-box;
		    display: -ms-flexbox;
		    background: #fff;
		    border-bottom: 1px solid #e5e5e5;
		    text-align: center;
		    height: .86rem;
		    line-height: .86rem;
		    -webkit-user-select: none;
		    font-size: 13px;
		    text-align: center;
		}
		.main {
			/*padding: 0!important;*/
			padding-top: 50px;
			z-index: 9999999;
		}
		.filterbar .category-wrapper {
		    overflow: scroll;
		}
		.category-wrapper {
			max-height: 480px!important;
		}
		.  .top-logo img{
      border-radius: 50%;
    }
    /*.weui-uploader__file {
        width: 40%;
        height: 79px;
    }*/
    .top-logo {
        width: 100%;
        height: 8em;
        margin-top: 1em;
        overflow: hidden;
    }
    .top-logo img {
        width: 6em;
        height: 6em;
        margin: 1em auto;
        display: block;
    }
    .weui-cell2:after {
        content: " ";
        position: absolute;
        left: 0;
        right: 0;
        height: 1px;
        color: #d9d9d9;
        bottom: 0;
        border-bottom: 1px solid #d9d9d9;
        -webkit-transform-origin: 0 100%;
        transform-origin: 0 100%;
        -webkit-transform: scaleY(.5);
        transform: scaleY(.5);
    }
    /*.weui-uploader__file {
          float: left;
          background: no-repeat 50%;
          background-size: cover;
          display: inline-block;
          margin: 0px 5%;
          background-size: 100% 100%;
      }*/
    .weui-cells {
	    margin-top: 0.2em;
	}
	.building_item {
	    width: 33.33%;
	    height: auto;
	    overflow: hidden;
	    float: left;
	    text-align: center;
	    font-size: 15px;
	}
	li {
		list-style: none;
	}
    </style>
  </head>

  <body ontouchstart style="background: #fff">

    <div class="navbar">
        <div class="nav-wrap-left">
            <if condition="$type eq 1">
                <a class="nav-btn" href="javascript:history.go(-1);">
                    <i style="font-size: 22px" class="iconfont icon-goback"></i>
                </a>
            </if>
        </div>
		<div class="nav-title">个人信息</div>
		<div class="nav-wrap-right">

        </div>
    </div>
    <!-- 正文 -->
    <div class="main">

    	<div class="weui-cells weui-cells_form">
    		<div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
		        <div class="weui-cell__bd">
		            <input id="user_name" class="weui-input" type="text" placeholder="请输入姓名" value="{$info.name}">
		        </div>
		    </div>
		    <div class="weui-cell">
	          	<div class="weui-cell__hd"><label for="name" class="weui-label">性别</label></div>
          		<div class="weui-cell__bd">
					<if condition="$info['sex'] eq 1">
						<input id="user_sex" class="weui-input" type="text" value="男" placeholder="请选择性别" readonly>
						<else/>
	             	<input id="user_sex" class="weui-input" type="text" value="" placeholder="请选择性别" readonly>
						</if>
	          	</div>
        	</div>
        	<div class="weui-cell">
		        <div class="weui-cell__hd"><label for="name" class="weui-label">现居城市</label></div>
		        <div class="weui-cell__bd">
		        	<if condition="$info['w_id'] gt 1">
						<input id="user_address" class="weui-input" type="text" placeholder="请选择现居城市" value="{$info.province} {$info.addr}">
					<else/>
						<input id="user_address" class="weui-input" type="text" placeholder="请选择现居城市" >
		        	</if>
		        	
		        </div>
		    </div>
    		<!-- <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">摄像头</label></div>
		        <div class="weui-cell__bd">
		            <input id="adacitvity_name" class="weui-input" type="text" placeholder="请选择摄像头线路">
		        </div>
		    </div> -->
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">手机号</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_phone" class="weui-input" type="tel" placeholder="请输入手机号" value="{$info.phone_num}">
		        </div>
        		<div class="weui-cell__ft">
          			<button id="vcodeBtn" class="weui-vcode-btn">获取验证码</button>
        		</div>
                <div class="weui-cell__ft has-send" style='display:none;'>
              		<button id="vcodeBtn1" class="weui-vcode-btn">已发送</button>
                </div>
		    </div>
        	<div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">验证码</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_vcode" class="weui-input" type="number" placeholder="请输入验证码">
		        </div>
		    </div>
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">学校名称</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_school" class="weui-input" type="text" placeholder="毕业学校名称" value="{$info.school}">
		        </div>
		    </div>
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">身份证号</label>
        </div>
		        <div class="weui-cell__bd">
					<input id="user_idCard"  class="weui-input"  placeholder="请输入身份证号" type="text" maxlength="18" minlength="18" onkeyup="value=value.replace(/^[a-zA-Z]+\D*|^\d{0,16}[a-zA-Z]+|[^0-9Xx]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" value="{$info.card_num}"/>
		        </div>
		    </div>
            <!--
            <div class="weui-cell">
                <div class=""><label class="" >上传身份证</label></div>
                <empty name="img">
                    <div class="weui-uploader__bd" style="padding: 10px;width: 100%;box-sizing: border-box;">
                        <ul class="weui-uploader__files" id="uploaderFiles1" >
                        </ul>
                        <div class="weui-uploader__input-box">
                            <span id="uploaderInput1" class="weui-uploader__input" onclick="chooseImage(this,'edit')">
                        </div>
                    </div>
                <else />
                    <div class="weui-uploader__bd" style="padding: 10px;width: 100%;box-sizing: border-box;">
                        <ul class="weui-uploader__files" id="uploaderFiles1" >
                            <li class="weui-uploader__file" style="background-image:url(http://house.wechatpic.com/upload/weixin/{$img}"></li>
                        </ul>
                        <div class="weui-uploader__input-box">
                            <span id="uploaderInput1" class="weui-uploader__input" onclick="chooseImage(this,'edit')">
                        </div>
                    </div>
                </empty>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">身份证上传</label></div>
                <div class="form-group">

                    <div class="ipt image_container">
                        <if condition='$info.img eq null'>
                            <img src="__STATIC__/vote_042.png" alt="" id="preview">
                            <input type="file" name='logo' id="exampleInputFile1" class="file_upload">
                        <else/>
                            <img src="http://house.wechatpic.com/upload/loupan/{$info.img}" alt="" id="preview">
                            <input type="file" name='logo' id="exampleInputFile1" class="file_upload">
                        </if>
                    </div>
                </div>
            </div>

            <script>
                    $('.file_upload').on('change',function(){
                        var mgObjPreview=$(this).siblings('img')[0];
                        var docObj=$(this)[0];
                        mgObjPreview.src = window.URL.createObjectURL(docObj.files[0]);
                    });
            </script>
            -->
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">开户银行(选填)</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_bankcard" class="weui-input" type="text" placeholder="请输入开户银行" value="{$info.bank}">
		        </div>
		    </div>
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">工资卡号(选填)</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_bankid" class="weui-input" type="tel" placeholder="请输入工资卡号" value="{$info.bank_num}">
		        </div>
		    </div>
		    <div class="weui-cell weui-cell_vcode">
          		<div class="weui-cell__hd">
            		<label class="weui-label">银行预留号码(选填)</label>
          		</div>
          		<div class="weui-cell__bd">
            		<input id="user_bankphone" class="weui-input" type="tel" placeholder="银行预留号码" value="{$info.bank_phone}">
          		</div>
          		<!-- <div class="weui-cell__ft">
            		<button id="vcodeBtn" class="weui-vcode-btn">获取验证码</button>
          		</div>
                <div class="weui-cell__ft has-send" style='display:none;'>
                	<button id="vcodeBtn1" class="weui-vcode-btn">已发送</button>
                </div> -->
        	</div>

        	<!-- <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">验证码</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_vcode" class="weui-input" type="number" placeholder="请输入验证码">
		        </div>
		    </div> -->
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">支付宝姓名</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_ailpayname" class="weui-input" type="text" placeholder="请输入支付宝姓名" value="{$info.alipay_name}">
		        </div>
		    </div>
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">支付宝帐号</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_ailpaynum" class="weui-input" type="text" placeholder="请输入支付宝帐号" value="{$info.alipay_account}">
		        </div>
		    </div>
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">紧急联系人</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_emergencyName" class="weui-input" type="text" placeholder="请输入紧急联系人" value="{$info.finder}">
		        </div>
		    </div>
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">紧急联系方式</label></div>
		        <div class="weui-cell__bd">
		          <input id="user_emergencyNum" class="weui-input" type="tel" placeholder="请输入紧急联系方式" value="{$info.finder_phone}">
		        </div>
                <input type='hidden' id='code' value='' disabled>
		    </div>

	  	</div>
		<div class="weui-btn-area">
	      <a class="weui-btn weui-btn_primary" href="javascript:" id="updateInfo">提交</a>
	    </div>

        <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
		<!--表单验证-->
        <script>
			function IDCardCheck(num) {
				num = num.toUpperCase();
				// 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X。
				if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(num))) {
					// alert('输入的身份证号长度不对，或者号码不符合规定！\n15位号码应全为数字，18位号码末位可以为数字或X。');
					return false;
				}
				// 校验位按照ISO 7064:1983.MOD 11-2的规定生成，X可以认为是数字10。
				// 下面分别分析出生日期和校验位
				var len, re;
				len = num.length;
				if (len == 15) {
					re = new RegExp(/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/);
					var arrSplit = num.match(re);

					// 检查生日日期是否正确
					var dtmBirth = new Date('19' + arrSplit[2] + '/' + arrSplit[3] + '/' + arrSplit[4]);
					var bGoodDay;
					bGoodDay = (dtmBirth.getYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]));
					if (!bGoodDay) {
						// alert('输入的身份证号里出生日期不对！');
						return false;
					}
					else {
						// 将15位身份证转成18位
						// 校验位按照ISO 7064:1983.MOD 11-2的规定生成，X可以认为是数字10。
						var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
						var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
						var nTemp = 0, i;
						num = num.substr(0, 6) + '19' + num.substr(6, num.length - 6);
						for (i = 0; i < 17; i++) {
							nTemp += num.substr(i, 1) * arrInt[i];
						}
						num += arrCh[nTemp % 11];
						return true;
					}
				}
				if (len == 18) {
					re = new RegExp(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/);
					var arrSplit = num.match(re);

					// 检查生日日期是否正确
					var dtmBirth = new Date(arrSplit[2] + "/" + arrSplit[3] + "/" + arrSplit[4]);
					var bGoodDay;
					bGoodDay = (dtmBirth.getFullYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]));
					if (!bGoodDay) {
						// alert(dtmBirth.getYear());
						// alert(arrSplit[2]);
						// alert('输入的身份证号里出生日期不对！');
						return false;
					}
					else {
						// 检验18位身份证的校验码是否正确。
						// 校验位按照ISO 7064:1983.MOD 11-2的规定生成，X可以认为是数字10。
						var valnum;
						var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
						var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
						var nTemp = 0, i;
						for (i = 0; i < 17; i++) {
							nTemp += num.substr(i, 1) * arrInt[i];
						}
						valnum = arrCh[nTemp % 11];
						if (valnum != num.substr(17, 1)) {
							// alert('18位身份证的校验码不正确！'); //应该为： + valnum
							return false;
						}
						return true;
					}
				}
				return false;
			}
		/*根据身份证号码获取年龄*/
        function IdCard(UUserCard,num){
            if(num==1){
                //获取出生日期
                birth=UUserCard.substring(6, 10) + "-" + UUserCard.substring(10, 12) + "-" + UUserCard.substring(12, 14);
                return birth;
            }
            if(num==2){
                //获取性别
                if (parseInt(UUserCard.substr(16, 1)) % 2 == 1) {
                    //男
                    return "男";
                } else {
                    //女
                    return "女";
                }
            }
            if(num==3){
                //获取年龄
                var myDate = new Date();
                var month = myDate.getMonth() + 1;
                var day = myDate.getDate();
                var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
                if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
                    age++;
                }
                return age;
            }
        }
	var wait=60;
	function time(o) {
		if (wait == 0) {
			o.removeAttribute("disabled");
			o.innerHTML="获取验证码";
			wait = 60;
		} else {
			o.setAttribute("disabled", true);
			o.innerHTML="重新发送(" + wait + ")";
			wait--;
			setTimeout(function() {
				time(o)
			},1000)
		}
	}
        //获取验证
        $('#vcodeBtn').click(function(){
            var mobile = $('#user_phone').val();
            if(mobile == ''){
                alert('请先输入手机号哦!');return false;
            }
            if(!(/^1[3|4|5|7|8]\d{9}$/.test(mobile))){
                    alert("手机号码格式有误，请重填");
                    return false;
                }
            // $('.weui-cell__ft').hide();
            // $('.has-send').show();
            time(this)
	$.ajax({
		url:"http://house.wechatpic.com/Mobile/My/getCode",
		data:{mobile:mobile},
		type:"GET",
		dataType:"JSON",
		success:function(res){
			if(res){
				$("#code").val(res.code);

			}
		}
	})
        })
        $('#updateInfo').click(function(){
            var logo = $('.file_upload').val();
            var user_name = $('#user_name').val();
            if(user_name == ''){
                alert('请输入姓名');return false;
            }
            var user_sex = $('#user_sex').val();
            if(user_sex == ''){
                alert('请选择性别');return false;
            }
            var user_address = $('#user_address').val();
            if(user_address == ''){
                alert('请选择地址');return false;
            }
            var user_phone = parseInt($('#user_phone').val());
            if(user_phone == ''){
                alert('请输入手机号');return false;
            }
            if(!(/^1[3|4|5|7|8]\d{9}$/.test(user_phone))){
                    alert("手机号码格式有误，请重填");
                    return false;
                }
            var user_school = $('#user_school').val();
            if(user_school == ''){
                alert('请输入毕业学校名称');return false;
            }
            var user_idCard = $('#user_idCard').val();
            if(!user_idCard || IDCardCheck(user_idCard)==false){
                alert('请输入正确身份证号');return false;
            }
             var user_bankcard = $('#user_bankcard').val();
            // if(user_bankcard == ''){
            //     alert('请输入开户银行');return false;
            // }
             var user_bankid = $('#user_bankid').val();
            // if(user_bankid == ''){
            //     alert('请输入开户银行卡号');return false;
            // }
            var user_bankphone = $('#user_bankphone').val();
            if(user_bankphone != ''){
                // alert('请输入预留号码');return false;
                if(!(/^1[3|4|5|7|8]\d{9}$/.test(user_bankphone))){
                        alert("预留号码格式有误，请重填");
                        return false;
                    }
            }
            
            var user_vcode = $('#user_vcode').val();
            var code = $('#code').val();
            //alert(user_vcode);alert(code);
            if(user_vcode == ''){
                alert('请输入验证吗');return false;
            }
            if(user_vcode != code){
                alert('请输入正确验证码');return false;
            }
            var user_ailpayname = $('#user_ailpayname').val();
            // if(user_ailpayname == ''){
            //     alert('请输入支付宝姓名');return false;
            // }
            var user_ailpaynum = $('#user_ailpaynum').val();
            // if(user_ailpaynum == ''){
            //     alert('请输入支付宝帐号');return false;
            // }
            var user_emergencyName = $('#user_emergencyName').val();
            if(user_emergencyName == ''){
                alert('请输入紧急联系人');return false;
            }
            var user_emergencyNum = $('#user_emergencyNum').val();
            if(user_emergencyNum == ''){
                alert('请输入紧急联系方式');return false;
            }
            if(!(/^1[3|4|5|7|8]\d{9}$/.test(user_emergencyNum))){
                    alert("紧急联系方式格式有误，请重填");
                    return false;
                }

            var ages= IdCard(user_idCard,3);
            var img = [];
            $("li").each(function(i){
                img[i]=($(this).attr("data"))
            });
            $.ajax({
                    url: "http://house.wechatpic.com/Mobile/My/addInfo",
                    type:'GET',
                    dataType : "json",
                    data: {user_name:user_name,user_sex:user_sex,user_address:user_address,user_phone:user_phone,user_school:user_school,user_idCard:user_idCard,ages:ages,user_bankcard:user_bankcard,user_bankid:user_bankid,user_bankphone:user_bankphone,user_vcode:user_vcode,user_ailpayname:user_ailpayname,user_ailpaynum:user_ailpaynum,user_emergencyName:user_emergencyName,user_emergencyNum:user_emergencyNum,img:img},
                     success: function (res) {
                             if(res.res == 1){
                                alert(res.msg);
                                location.href="{:U('myInfo_show')}";
                             }else{
                                alert(res.msg);return false;
                             }
                       },
                       error:function(){
                        alert('请求提交失败');
                       }
               });
        })

        </script>
		<!-- <div class="weui-cells weui-cells_form">
	  		<div style="text-align: center;padding: 5px 0;background: #ffd966;color: #000;font-family: "黑体";">兼职记录</div>
		    <div id="joblist" style="min-height: 10px">
	        	<div class="shade" style="display: none;"></div>
	            <ul id="job-all" class="list demos-content-padded" style="min-height: 10px">
                <foreach name="h_info" item="vo" >
	            	<li>
	                	<a class="list-item clearfix">
	                        <div class="building_item">
	                            <a href="{:U('myInfo2')}?aid={$vo['a_id']}">{$vo['job_name']}</a>
	                        </div>
	                        <div class="building_item">
	                            {$vo['name']}
	                        </div>
	                        <div class="building_item">
	                        	{$vo['create_time']|date="Y-m-d",###}
	                        </div>

	                    </a>
	           		</li>
	           	</foreach>
	            </ul>

	        </div>

    	</div> -->
	  	</div>
    </div>
	<div id="allmap1"></div>
    <script>
  		$(function() {
            wx.config({
                debug: false,
                appId: '{$sign.appId}',
                timestamp: '{$sign.timestamp}',
                nonceStr:'{$sign.nonceStr}',
                signature:'{$sign.signature}',
                jsApiList: [
                    'chooseImage','uploadImage'
                ]
            });
      	var obj2 =["一路", "二路", "三路"];
        $("#adacitvity_name").select({
	        title: "线路",
	        multi: false,
	        min: 1,
	        // max: 3,
	        items: obj2,
	        beforeClose: function(values, titles) {

	        },
	        onChange: function(d) {
	          console.log(this, d);
	        },
	        onClose: function (d) {
	          console.log('close')
	        }
      	});
      	// $("#user_sex").select({
       //    title: "选择性别",
       //    items: [
       //      {
       //        title: "男",
       //        value: "1",
       //      },
       //      {
       //        title: "女",
       //        value: "2",
       //      }
       //    ]
       // });
		$("#user_sex").picker({
		  title: "选择性别",
		  cols: [
		    {
		      textAlign: 'center',
		      values: ['男','女']
		    }
		  ]
		});
      	$("#user_address").cityPicker({
          title: "选择出发地",
          showDistrict: false,
          onChange: function (picker, values, displayValues) {
            console.log(values, displayValues);
          }
        });
  	});

    //照片上传
    function chooseImage(obj,o_id){
        // 选择张片
        wx.chooseImage({
            count: 1, // 默认9
            sizeType: [ 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
            sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
            success: function(res) {
                var localIds = res.localIds;

                // 上传照片
                uploadImg(localIds,o_id)
            }
        });
    }
    function uploadImg(localIds,o_id){
            var localId = localIds.pop();
            wx.uploadImage({
                localId: localId,
                isShowProgressTips: 1,
                success: function(res) {
                    serverId =res.serverId;

                    $.ajax({

                        url:"{:U('My/get_img')}",
                        type:"POST",
                        dataType:"json",
                        data:{img_id:serverId,id:"<?php echo $_GET['a_id'];?>",o_id:o_id},
                        success:function(ret){
                            //返回图片在服务器地址ret.save_path
                            var imgSrc = ret.save_path
                            if(ret.ret==1){
                                //alert(localIds)
                                // 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片
                                var ul = $(".weui-uploader__bd").find("ul");

                                //添加 li
                                var li = document.createElement("li");

                                //设置 li 属性，如 id
                                li.setAttribute("class", "weui-uploader__file");
                                li.setAttribute("data", imgSrc);
                                li.setAttribute("style", "background-image:url("+"http://house.wechatpic.com/upload/weixin/"+imgSrc+")");
                                ul.append(li);
                            }
                            if(localIds.length > 0){
                                uploadImg(localIds,o_id);
                            }
                        },
                        error : function(x,y,z){
                            console.log(x);
                            console.log(y);
                            console.log(z);
                        }
                    })
                }
            });


        }
    </script>
    <script src="__STATIC__/mobile/js/jquery-weui.js"></script>
    <script src="__STATIC__/mobile/js/city-picker.js"></script>
    <script src="__STATIC__/mobile/js/globalvariable.js"></script>
    <script src="__STATIC__/mobile/js/sose.js"></script>
    <script>






    </script>
  </body>
</html>
